#include<algorithm>
#include<iostream>
#include<string>
const int N = 1e6 + 10;
int a[N], b[N], c[N];
using namespace std;
int main()
{
	string s1, s2;cin >> s1 >> s2;
	int la = s1.size();int lb = s2.size();
	int lc = max(la, lb);
	if (la < lb || (la == lb && s1 < s2))
	{
		swap(s1, s2);
		swap(la, lb);
	}
	for (int i = 0; i < la; i++)
	{
		a[i] = s1[la - i - 1] - '0';
	}
	for (int i = 0; i < lb; i++)
	{
		b[i] = s2[lb - i - 1] - '0';
	}
	for (int i = 0; i < lc; i++)
	{
		if (a[i] < b[i])
		{
			a[i] += 10;
			a[i + 1]--;
		}
		c[i] = a[i] - b[i];
	}
	while (c[lc - 1] == 0 && lc > 1) lc--;
	for (int i = lc - 1; i >= 0; i--)
	{
		cout << c[i];
	}
		return 0;
}